-
Notifications
You must be signed in to change notification settings - Fork 1
Conversation
omi_api/views/compositions.py
Outdated
@@ -39,6 +39,8 @@ def post(self): | |||
location='json') | |||
parser.add_argument('publishers', type=list, required=True, | |||
location='json') | |||
parser.add_argument('iswc', type=str, required=True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll make required=False
. However, then matching recordings and compositions won't work for this implementation.
@vrde and I talked.
omi_api/queries.py
Outdated
|
||
|
||
def unpack(doc): | ||
return doc['block']['transactions']['asset']['data'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For prosperity: One must be able to do this in a MDB query directly 🤔
omi_api/utils.py
Outdated
@@ -19,5 +19,6 @@ def get_bigchaindb_api_url(): | |||
def queryparams_to_dict(queryparams): | |||
queryparams = dict(queryparams) | |||
for k, v in queryparams.items(): | |||
queryparams[k] = v[0] | |||
if v: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh thanks! I remember thinking about this during implementation. Then I forgot.
bdb = BigchainDB(get_bigchaindb_api_url()) | ||
|
||
recordings_compositions_views = Blueprint('recordings_compositions_views', | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rm line? @vrde I can do it; or was it intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh remove it.
return 'Composition and Recording were successfully connected.', 200 | ||
|
||
|
||
recordings_compositions_api.add_resource( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also need an /compositions/recordings
endpoint. I imagine that is not a lot of work (same functionality can be reused).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not a lot of work, it's actually just one line to implement this. I didn't do it yet because I didn't want to diverge from the specs too much.
|
||
tx = bdb.transactions.prepare( | ||
operation='CREATE', | ||
signers=config.PUBLIC_KEY, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When #26 is merged, we should adjust this.
signers=config.PUBLIC_KEY, | ||
asset={'data': link}) | ||
|
||
signed_tx = bdb.transactions.fulfill(tx, private_keys=config.PRIVATE_KEY) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When #26 is merged, we should adjust this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add documentation in Readme.md.
Other than that: Great work!
184423f
to
54ec470
Compare
Add
recordings/compositions
endpoint to:isrc
andiswc
codes.